//
//  HWBookIndexCell.m
//  嗨文
//
//  Created by 响当当 on 2019/3/16.
//  Copyright © 2019年 dongzheng. All rights reserved.
//

#import "HWBookIndexCell.h"

@interface HWBookIndexCell()
@property (nonatomic, strong)UILabel *indexLabel;//目录
@property (nonatomic, strong)UILabel *timeLabel;//时间

@end

@implementation HWBookIndexCell

- (UILabel *)indexLabel
{
    if (!_indexLabel)
    {
        
        UILabel *titleLabel = [HWUtilties creatLabelWithFrame:CGRectMake(17*kUIScaleBasePlus,14*kUIScaleBasePlus,60*kUIScaleBasePlus,15*kUIScaleBasePlus)
                                                 textAligment:NSTextAlignmentLeft
                                                     textClor:LCHexColor(0x363636) textFont:16*kUIScaleBasePlus];
        titleLabel.text = @"目录";
        [self.contentView addSubview:titleLabel];
        
        _indexLabel = [HWUtilties creatLabelWithFrame:CGRectMake(15*kUIScaleBasePlus,CGRectGetMaxY(titleLabel.frame)+16*kUIScaleBasePlus,300*kUIScaleBasePlus,13*kUIScaleBasePlus)
                                         textAligment:NSTextAlignmentLeft
                                             textClor:LCHexColor(0x828282)
                                             textFont:13*kUIScaleBasePlus];
        
    }
    return _indexLabel;
}

- (UILabel *)timeLabel
{
    if (!_timeLabel)
    {
        
        _timeLabel = [HWUtilties creatLabelWithFrame:CGRectMake(15*kUIScaleBasePlus,CGRectGetMaxY(self.indexLabel.frame)+10*kUIScaleBasePlus,300*kUIScaleBasePlus,13*kUIScaleBasePlus)
                                         textAligment:NSTextAlignmentLeft
                                             textClor:LCHexColor(0x828282)
                                             textFont:13*kUIScaleBasePlus];
        
    }
    return _timeLabel;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        [self.contentView addSubview:self.indexLabel];
        [self.contentView addSubview:self.timeLabel];
    }
    return self;
}

#pragma mark - 获取数据
- (void)getDic:(NSDictionary *)dic
{
    self.indexLabel.text = dic[@"index"];
    self.timeLabel.text = dic[@"time"];

}
@end
